﻿@model OnlineMealOrdering.Areas.WebSiteManage.Models.StoreOnlineModel
@{
    ViewBag.Title = "编辑基本信息店铺";
    Layout = "~/Areas/WebSiteManage/Views/Shared/_Layout.cshtml";
}
<script type="text/javascript" src="http://api.map.baidu.com/api?v=1.5&ak=C06d429c09fd4cd636af81d60e14a4ed"></script>
<div class="row-fluid sortable ui-sortable">
    <div class="box span12">
        <div data-original-title="" class="box-header">
            <h2><i class="icon-edit"></i><span class="break"></span>店铺信息</h2>
        </div>
        <div class="box-content" id="content">
            @using (Ajax.BeginForm("SettingUser", "", new AjaxOptions { HttpMethod = "POST" }, new { @class = "form-horizontal" }))
            {
                <div class="row">
                </div>
                <fieldset>
                    <div class="control-group" id="userId" style="display: none;">
                        @Html.LabelFor(a => a.Id, new { @class = "control-label" })
                        <div class="controls">
                            <span class="help-inline">@Model.Id</span>
                            @Html.HiddenFor(a => a.Id)
                        </div>
                    </div>

                    <div class="control-group">
                        @Html.LabelFor(a => a.LogoImage, new { @class = "control-label" })
                        @Html.HiddenFor(a => a.LogoImage, new { @id = "newLogoImage" })
                        <div class="controls">
                            <img src="~/Areas/WebSiteManage/Content/img/微博桌面2012_3321810727.JPG"
                                class="img-rounded" id="storelogo" style="width: 600px; height: 150px;">
                        </div>
                    </div>
                    <div class="control-group" style="margin-bottom: 30px; width: 200px;">
                        <div class="controls">
                            <input type="file" id="file_upload" name="file_upload" />
                            <div id="fileQueue" class="uploadify-queue" style="width: 600px;"></div>
                        </div>
                    </div>

                    <div class="control-group">
                        @Html.LabelFor(a => a.Name, new { @class = "control-label" })
                        <div class="controls">
                            @Html.TextBoxFor(a => a.Name, new { @class = "input-xlarge" })
                        </div>
                    </div>
                    <div class="control-group">
                        @Html.LabelFor(a => a.Tel, new { @class = "control-label" })
                        <div class="controls">
                            @Html.TextBoxFor(a => a.Tel, new { @class = "input-xlarge" })
                        </div>
                    </div>
                    <div class="control-group">
                        @Html.LabelFor(a => a.Phone, new { @class = "control-label" })
                        <div class="controls">
                            @Html.TextBoxFor(a => a.Phone, new { @class = "input-xlarge" })
                        </div>
                    </div>
                    <div class="control-group">
                        @Html.LabelFor(a => a.QQ, new { @class = "control-label" })
                        <div class="controls">
                            @Html.TextBoxFor(a => a.QQ, new { @class = "input-xlarge" })
                        </div>
                    </div>
                    <div class="control-group">
                        @Html.LabelFor(a => a.BeginBusinessTime, new { @class = "control-label" })
                        <div class="controls">
                            @Html.TextBoxFor(a => a.BeginBusinessTime, new { @class = "input-xlarge datepicker hasDatepicker" })
                        </div>
                    </div>
                    <div class="control-group">
                        @Html.LabelFor(a => a.EndBusinessTime, new { @class = "control-label" })
                        <div class="controls">
                            @Html.TextBoxFor(a => a.EndBusinessTime, new { @class = "input-xlarge datepicker hasDatepicker" })
                        </div>
                    </div>
                    <div class="control-group">
                        @Html.LabelFor(a => a.Description, new { @class = "control-label" })
                        <div class="controls">
                            <textarea style="width: 300px;">@Model.Description</textarea>
                        </div>
                    </div>
                    <div class="control-group">
                        @Html.LabelFor(a => a.Contact, new { @class = "control-label" })
                        <div class="controls">
                            <textarea style="width: 300px;">@Model.Contact</textarea>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">位置</label>
                        <div class="controls">
                            <div class="input-append">
                                @Html.TextBoxFor(a => a.LongLati, new { @id = "location",@size=16,la=Model.Latitude,lo=Model.Longitude })
                                <button id="selectLocation" class="btn" type="button">选择</button>
                            </div>
                        </div>
                    </div>

                    <div class="form-actions">
                        <button class="btn btn-primary" type="submit">保 存</button>
                        <a class="btn " href="@Url.Action("StoreOnlineList")">取 消</a>
                    </div>
                </fieldset> 
                         
            }
        </div>
    </div>

</div>
<script type="text/javascript">
    function showLoaction() {        
        var lo = $("#location").attr("lo");
        var la = $("#location").attr("la");        
        $(".modal-body").load('/WebSiteManage/Component/UserLocation?lo=' + lo + '&la=' + la, function () {
            $("#myModal").modal({
                backdrop: false,
                keyboard: true,
            });
        })
    }
    $(function uploadInit() {
        $("#file_upload").uploadify({
            'swf': '/Scripts/uploadify/uploadify.swf',
            'uploader': '/WebSiteManage/UploadFiles/UploadFiles',
            'fileTypeExts': '*.gif; *.jpg; *.png',
            'multi': false,
            'queueID': 'fileQueue',
            'cancelImg': '/Scripts/uploadify/uploadify-cancel.png',
            'onUploadSuccess': function (file, data, response) {
                var respondata = $.parseJSON(data);
                var imgurl = respondata.rawFileRelativePath + '/' + respondata.fileGuid + respondata.fileType;
                $("#newLogoImage").val('/' + imgurl);
                $("#storelogo").attr("src", '/' + imgurl);
            }
        });

        $("#selectLocation").bind("click", function () {
            showLoaction();
        });
    })();

</script>
